package cn.ac.iie.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

  @Override
  public void addFormatters(FormatterRegistry registry) {
    registry.addFormatter(new LocalDateTimeFormatter("yyyy-MM-dd HH:mm:ss"));
    registry.addFormatter(new LocalDateFormatter("yyyy-MM-dd"));
    registry.addFormatter(new LocalTimeFormatter("HH:mm:ss"));
  }
}
